<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><!-- JavaScript （开始） -->
		<!-- 定义权限信息 -->
		<script type="text/javascript">
		
			var types = {SEARCH:1,CREATE:2,REMOVE:4,MODIFY:8};
		
			var privileges = new Object();
			
			Ext.Ajax.request({
				url : basePath + 'services/rest/system/users/privileges'
				, method : 'GET'
				, success : function(response) {
					var text = response.responseText;
					var json = Ext.JSON.decode(text);
					for (var i = 0; i < json.length; i++) {
						var privilege = json[i];
						if (typeof(privileges[privilege.uri]) == 'undefined') {
							privileges[privilege.uri] = types[privilege.type];
						} else {
							privileges[privilege.uri] += types[privilege.type];
						}
					}
				}
				, failure : function(response) {
				}
			});
		
			function hiddenMenu(url, operation) {
				if (typeof(privileges) != 'undefined') {
					var accessor = privileges[url]; // 查找到对应的权限值
					var hasPrivilege = (accessor & operation) == operation; // 判断是否有权限
					return !hasPrivilege;
				}				
				return true;
			}
			
		</script>
		<!-- JavaScript （结束） -->
